exports.updateRedBagActivity = function (req, res) {

    //获取restful参数
    var bodyParams = req.routeInfo.bodyParams;
    //最终结果
    var resultData = {};

    var updateInfo = 0;

    //任务流创建
    async.waterfall([
        //1.权限验证
        /*function (cb) {
            P.permissionValidation(req, res, [CORE_APIConfig.coreAPI.updateOrganizationActivity], function () {
                cb()
            });
        },*/

            //查询_更新促销活动基本信息
            function (cb) {
                R.SEND_HTTP(
                    req,
                    {
                        url: CORE_APIConfig.coreAPI.updateOrganizationActivity,
                        method: 'POST',
                        data: {
                            oa_id: bodyParams.activity_id,
                            oa_title: bodyParams.activity_name,
                            oa_start_time: bodyParams.activity_start_time,
                            oa_end_time: bodyParams.activity_end_time,
                            oa_thumbnail: bodyParams.oa_thumbnail,
                            oa_title_image_type: bodyParams.oa_title_image_type,
                        }

                    },
                    function (err, data) {
                        //判断是否有错误信息
                        updateInfo = data;

                        cb();
                    }
                );
            },
        function (cb) {
            if(!updateInfo){
                RES.response(res, false,"更新失败");
            }else{
                R.SEND_HTTP(
                    req,
                    {
                        url: CORE_APIConfig.coreAPI.updateCashCoupon,
                        method: 'POST',
                        data: {
                            cc_id: bodyParams.coupon_id,
                            cc_name: bodyParams.coupon_name,
                            cc_price: bodyParams.coupon_price,
                            cc_start_time: bodyParams.coupon_start_time,
                            cc_end_time: bodyParams.coupon_end_time,
                            cc_type: bodyParams.coupon_type,
                            cc_fid: bodyParams.coupon_fid,
                            cc_max_count: bodyParams.coupon_max_count,
                            cc_max_price: bodyParams.coupon_max_price,
                        }

                    },
                    function (err, data) {
                        //判断是否有错误信息
                        updateInfo = data;

                        cb();
                    }
                );
            }
        }

        ], function (err, result) {
            //返回最终拼接结果
            RES.response(res, true, resultData);
        }
    );
}